home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 86 / MF_UK_86_1.iso / Shareware Plus / Utilities / Reaper 132 / Source Code / Reaper Kick.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-21  |  1.1 KB  |  71 lines  |  [TEXT/CWIE]

  1. // AKUA Protos OneFile
  2. #include    "yLibCfg.h"
  3.  
  4. #include    "Reaper.h"
  5.  
  6. #include    "yAgtINIT.h"
  7. #include    "yAgtTRAP.h"
  8. #include    "yDraw.h"
  9. #include    "yFixedMath.h"
  10. #include    "yGlobal.h"
  11. #include    "yString.h"
  12.  
  13. #include    <Appearance.h>
  14.  
  15.  
  16.  
  17. //
  18. // For PPC Code resource
  19. #if            ISAPPC
  20. ProcInfoType    __procinfo = bpiObjAgt;
  21. #endif    //    ISAPPC
  22.  
  23.  
  24. // AKUA Statics Beg
  25. oaVal main(oaObj initBlkObj);
  26. // AKUA Statics End
  27.  
  28.  
  29.  
  30.  
  31. oaVal main(oaObj initBlkObj) 
  32.  {
  33.     initBlk        init = (initBlk)initBlkObj;
  34.  
  35.     if (init->versCompat > kvrInitBlkCompat)
  36.         return    50;
  37.  
  38.     EnterCodeRsrc();
  39.  
  40.     // Check our gestalt selector
  41.     long        dummy;
  42.     yError        err        = gestaltDupSelectorErr;        // Already installed
  43.  
  44.     if (!Gestalt(igsReaper, &dummy))
  45.         goto deadlyError;
  46.  
  47.     err = noErr;
  48.  
  49.     // bkkEternal - since we stay resident, load and detach 'PREF' resource
  50.     init->flags = bkkPrefLoad | bkkPrefDetach;
  51.  
  52.     // Just for kicks
  53.     Point    p;
  54.     mcPtX(p) = 64;
  55.     mcPtY(p) = 32;
  56.     msLocSet(p);
  57.  
  58.     // Show our icon, get prefs
  59.     CallObjAgt(init->kickAgt, init);
  60.  
  61.     // Pass on ptr to LMGetFCBSPtr()
  62.     if (UInt32 * badguy = fcGet())
  63.         init->trapData = fcIsPatchable(badguy) ? badguy : NULL;
  64.  
  65. deadlyError:
  66.     LeaveCodeRsrc();
  67.     return    err;
  68.  }
  69.  
  70.  
  71. #include    "msLoc.c"